package com.bawei.contentprovider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

/**
 * @Author : yaotianxue
 * @Time : On 2023/6/6 14:45
 * @Description : MyHelper
 */
public class MyHelper extends SQLiteOpenHelper {
    public MyHelper(@Nullable Context context) {
        super(context,"user.db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table user (_id integer primary key autoincrement ,name varchar(30),age integer)");
        for(int i=1;i<10;i++){
            db.execSQL("insert into user values(null,?,?)",new String[]{"送定型"+i+"",i+""});
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
